Fix royalty ABI: correct parameter order and return values#263
Fix royalty ABI: correct parameter order and return values#263realproject7 merged 1 commit intomainfrom
Conversation
- getRoyaltyInfo: fix inputs to (wallet, reserveToken), outputs to (balance, claimed) — was (token, beneficiary) → single uint256 - claimRoyalties: pass reserve token (PLOT_TOKEN) not storyline token - ClaimRoyalties.tsx: swap args, destructure [balance] from return, use PLOT_TOKEN for both read and claim calls Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
APPROVE
ABI fix is correct and minimal:
-
getRoyaltyInfo: Inputs reordered to(wallet, reserveToken), outputs now tuple(balance, claimed). Call site correctly swaps to(beneficiary, PLOT_TOKEN)and destructures[balance]. -
claimRoyalties: Now takesPLOT_TOKEN(reserve token) instead oftokenAddress(storyline token). Matches the actual MCV2_Royalty contract signature. -
Query key: Still uses
[tokenAddress, beneficiary]which is correct —PLOT_TOKENis a constant so doesn't affect cache invalidation; the key properly varies by storyline context and wallet.
No issues found.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The PR fixes the ABI mismatch and updates the dashboard call sites to use the reserve-token-based royalty contract interface. The change is tightly scoped to the royalty read/claim path.
Findings
- [info] No blocking issues found.
Decision
Approve. lib/price.ts now matches the contract signature, and ClaimRoyalties.tsx calls/destructures the royalty methods with the correct argument order and return values. CI was still pending when reviewed.
Summary
getRoyaltyInfoABI: inputs changed from(token, beneficiary)to(wallet, reserveToken), outputs from singleuint256to(balance, claimed)claimRoyaltiesABI: pass reserve token address (PLOT_TOKEN) instead of storyline tokenClaimRoyalties.tsx: swap args togetRoyaltyInfo(beneficiary, PLOT_TOKEN), destructure[balance]from tuple return, callclaimRoyalties(PLOT_TOKEN)Fixes #261
Test plan
getRoyaltyInfocalled with(writerAddress, PLOT_TOKEN)— verified in contract callnpm run typecheckpasses🤖 Generated with Claude Code